import * as Cesium from 'cesium/Cesium';
import 'cesium/Widgets/widgets.css';

//earth
import Earth from './earth/Earth.js';
import { createEarth, createEarthWithSkybox } from '../test/earth/earth.js';

import Mars from './mars/Mars.js';

//layer
import addTerrain from "./../test/layer/terrain";
import addMapvLayer from "./../test/layer/mapv";
import addBaseLayers from "./../test/layer/imagery";
import add_vector_layer from "../test/layer/vector";
import add_feature_layer from '../test/layer/feature/test_feature_layer.js';
import addChartLayer from './../test/layer/chart/chart.js';
import add_theme_layer from '../test/layer/theme/test_theme.js';
import { add_tileset_layer } from './../test/layer/model.js';
import addRadarScanTest from './../test/animation/randar_scan.js';
import { add_widget } from '../test/widget/widget.js';

import { add_overlays } from '../test/overlay/overlay.js';
import { add_effect } from '../test/effect/effect.js';

import { add_layer_entity } from '../test/layer/layer_overlay.js';

//event
import {registerMouseListeners} from "./../test/event/mouseEvent";

import { cesium_animation_add_satellite, cesium_animation_add_gltf, cesium_satelite_create_czml_from_tle } from '../test/cesium/animation/satellite_t.js';
import { add_layer_primitive } from '../test/layer/layer_overlay_primitive.js';

import { test_source } from '../test/source/test_source.js';
import {test_styled_feature_layer } from '../test/layer/style/test_style_layer';

import add_onesis_layers from "../test/layer/onesis_layer";

export function run_test(){
    Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2OTkxY2ZlYS01NjQ1LTQwOTktODc4OS1mNTQ3NTk5NGZjY2YiLCJpZCI6MzE4OTUsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1OTYxMDU3NTl9.MfJB6x_8MAk5sq7VEHu-_OYj4K8ZHdWoirMkjJFvNFg';
    
    /** 
     * 创建XEarth对象 
     **/    
    //let earth = createEarth('cesiumContainer');
    let earth = createEarthWithSkybox('cesiumContainer');
    //注册Ehcarts    

    /**
     * 创建Mars对象
     */
    //let earth = new Mars('cesiumContainer');
    
    /** 注册鼠标事件 */
    registerMouseListeners(earth);

    /** 
     * Imagery: 添加BaseLayer
     **/
    addBaseLayers(earth);

    /** 
     * Terrain: 添加地形
     **/
    //addTerrain(earth);
    
    /** Layer：矢量图层  */
    //add_vector_layer(earth);
    //add_feature_layer(earth);

    /** Layer：3DTiles图层  */
    //add_tileset_layer(earth);

    /** Layer：ChartLayer */
    //addChartLayer(earth);

    /** 图层样式： */
    test_styled_feature_layer(earth);

    /** Layer：专题图 */
    //add_theme_layer(earth);
    
    //add_layer_primitive(earth);
    //add_layer_entity(earth);

    /** Layer: MapvLayer */
    //addMapvLayer(earth);

    /** 动画测试 */
    //addRadarScanTest(earth);

    /** overlay */
    //add_overlays(earth);

    /** effect */
    //add_effect(earth);

    /** 数据源测试 */
    //test_source(earth);

    /** OneSIS 图层数据 */
    //add_onesis_layers(earth);

    //add_widget("chartContainer");

    //cesium_animation_add_gltf(earth);
    //cesium_animation_add_satellite(earth);
    //cesium_satelite_create_czml_from_tle();

    //
    // let position = {
    //     lng : 121.489206,
    //     lat : 31.241320,
    //     alt : 100000.0
    // };

    
    // let position = {
    //     lng:116, lat:39.0, alt:1000000.0
    // };

    // earth.zoomToPosition(position)

    window.earth = earth;
} 
